<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	template="/design/template.xhtml">
  <ui:define name="body">

  <h:form id="frmProduct">
    <h:inputHidden id="productId" value="#{productAction.product.id}" /> 
    <p:panel id="pnlProduct" header="Dados produto">

      <p:messages/>
      <h:panelGrid columns="3" >
        <h:outputText value="Nome:" />
        <p:spacer width="8" />
        <p:inputText id="productName" value="#{productAction.product.name}" style="width:300px;"
          required="true" requiredMessage="Nome obrigatorio!">
        </p:inputText>
        <h:outputText value="Descrição:" />
        <p:spacer width="8" />
        <p:inputTextarea id="productDescription" value="#{productAction.product.description}" style="width:300px;" rows="4"></p:inputTextarea>
      </h:panelGrid>
      <p:spacer height="10" />
      <p:outputPanel id="pnlButons">
        <div align="left" id="divButons">
          <p:commandButton action="#{productAction.listProducts}" value="cancelar" update="pnlProduct" ajax="false" immediate="true" />
          <p:spacer width="10" />
          <p:commandButton action="#{productAction.editProduct}" value="alterar" update="pnlProduct" ajax="false" rendered="#{productAction.actionEdit}" />
          <p:commandButton action="#{productAction.insertProduct}" value="incluir" update="pnlProduct" ajax="false" rendered="#{productAction.actionInsert}" />
        </div>
      </p:outputPanel>
    
    </p:panel>
  
  </h:form>

  </ui:define>
</ui:composition>
